﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace NBusiness.CodeDom
{
    /// <summary>
    /// The Model is a subset of an entity for a specific usecase.
    /// </summary>
    /// <example>
    /// model BasicEmployee : Employee
    /// {
    /// }
    /// </example>
    [Serializable]
    public abstract class EntityModel : Entity
    {
        public Entity Base { get; set; }

        public bool IsReadOnly { get; set; }

        public override bool Equals(object obj)
        {
            if (!(obj is EntityModel)) return false;

            return Fullname.Equals((obj as EntityModel).Fullname);
        }

        public override int GetHashCode()
        {
            return base.GetHashCode();
        }
    }
}
